package edu.neumont.pro180._2009_q2.chess.pieceFactory;

import edu.neumont.pro180._2009_q2.GamePiece;
import edu.neumont.pro180._2009_q2.Player;
import edu.neumont.pro180._2009_q2.Square;
import edu.neumont.pro180._2009_q2.interfaces.IGamePiece;
import edu.neumont.pro180._2009_q2.interfaces.IGamePieceFactory;

public abstract class ChessPieceFactory implements IGamePieceFactory {
	@Override
	public IGamePiece CreatePiece(Player player, Square square) {
		GamePiece piece = makeCustomPiece();
		piece.setPlayer(player);
		piece.getMove(square).execute();
		return piece;
	}

	protected abstract GamePiece makeCustomPiece();
}
